package com.tbit.uqbike.object.view.sugar;

import java.io.Serializable;

/**
 * sugar大屏返回实体类
 *
 * @Author:BUGTian
 * @DATE: 2022/12/7
 */
public class ScreenResult<T> implements Serializable {
    /**
     * 响应结果的信息
     */
    private String msg;

    /**
     * 响应结果的信息状态码 0 表示成功 非0表示失败
     *
     * @mock 0
     */
    private Integer status;

    /**
     * 响应结果的逻辑数据
     */
    private T data;

    public ScreenResult(String msg, Integer status, T data) {
        this.msg = msg;
        this.status = status;
        this.data = data;
    }

    /**
     * 成功 并返回数据
     *
     * @param data
     * @param <T>
     * @return
     */
    public static <T> ScreenResult<T> success(T data) {
        return new ScreenResult<T>("", 0, data);
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
